<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>

    <head th:replace="/common/head :: head"></head>
    <style>
        li.select2-results__option{
            border-bottom:1px dashed #9a9a9a;
        }
    </style>

</head>
<body>
<!-- START PAGE CONTAINER -->
<div class="page-container">

    <!-- START PAGE SIDEBAR -->
    <div class="page-sidebar">
        <!-- START X-NAVIGATION -->
        <div th:replace="/common/left :: left"></div>
        <!-- END X-NAVIGATION -->
    </div>
    <!-- END PAGE SIDEBAR -->

    <!-- PAGE CONTENT -->
    <div class="page-content">

        <div th:replace="/common/top :: top"/>

        <!-- START BREADCRUMB -->
        <ul class="breadcrumb">
            <li><a href="#">Home</a></li>
            <li><a href="#">实例管理</a></li>
            <li class="active">模板实例列表</li>
        </ul>
        <!-- END BREADCRUMB -->

        <!-- PAGE CONTENT WRAPPER -->
        <div class="page-content-wrap">


            <div class="row">
                <div class="col-md-12">

                    <!-- START DATATABLE EXPORT -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">实例列表</h3>
                            <div class="pull-right">
                            </div>
                        </div>
                        <div class="panel-heading" style="float: right;">
                            <div class="btn-group">
                                <button type="button" class="btn btn-success dropdown-toggle"
                                        onclick="add()">
                                    <span class="glyphicon glyphicon-plus"></span>新增
                                </button>
                            </div>
                            <div class="btn-group">
                                <button type="button" class="btn btn-success dropdown-toggle"
                                        onclick="releaseConfig()">
                                    <span class="glyphicon glyphicon-send"></span>发布已修改模板
                                </button>
                            </div>
                        </div>

                        <div class="panel-heading" style="float: left;">


                                <label>环境</label>
                                <div class="btn-group" style="width:150px;">
                                    <select name="envCode" class="form-control" id="envCode" aria-required="true">

                                    </select>
                                </div>
                                <label>应用</label>
                                <div class="btn-group" style="width:150px;">
                                    <select name="appName" class="form-control" id="appName" aria-required="true">

                                    </select>
                                </div>
                                <label>模板</label>
                                <div class="btn-group" style="width:280px;">
                                    <select name="templateKey" class="form-control" style="" id="templateKey" >

                                    </select>
                                </div>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-success dropdown-toggle"
                                            onclick="loadData(false)">
                                        <span class="glyphicon glyphicon-search"></span>查询
                                    </button>
                                </div>



                                <div class="btn-group" style="width:200px;">
                                    <input name="description" class="form-control" id="description" placeholder="模糊搜索描述"/>
                                </div>
                                <div class="btn-group">
                                    <button type="button" class="btn btn-success dropdown-toggle"
                                            onclick="loadDataLike()">
                                        <span class="glyphicon glyphicon-search"></span>模糊查询
                                    </button>
                                </div>

                        </div>

                        <div class="panel-body">
                            <div class="table-responsive">
                                <table id="dataTables-userInfo" class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <!--<th width="5%">实例key</th>-->
                                        <th width="4%">优先级</th>
                                        <!--<th width="10%" >标题</th>-->
                                        <th  width="15%">描述</th>
                                        <!--<th  width="7%">开始时间</th>
                                        <th  width="7%">结束时间</th>-->
                                        <th  width="5%">状态</th>
                                        <th  width="5%">发布状态</th>
                                        <th width="4%">操作人</th>
                                        <th  width="7%">修改时间</th>
                                        <th  width="18%">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody id="tbody">

                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <!-- END DATATABLE EXPORT -->

                </div>
            </div>

        </div>
        <!-- END PAGE CONTENT WRAPPER -->
    </div>
    <!-- END PAGE CONTENT -->
</div>
<!-- END PAGE CONTAINER -->

<div id="toolbar">

</div>

<div class="modal fade" id="userInfoDelModal" tabindex="-1" role="dialog"
     aria-labelledby="userInfoDelModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="userInfoDelModalLabel">删除认证</h4>
            </div>
            <div class="modal-body">
                <input id="userInfoId" type="hidden">
                确定要删除么？
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="userInfoDel()">删除</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="editModal" tabindex="-1" role="dialog"
     aria-labelledby="userInfoEditModalLabel"
     aria-hidden="false"
     data-backdrop='static'
    >
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="userInfoEditModalLabel">修改</h4>
            </div>

            <div th:replace="/value/valueEdit :: valueEdit"/>

            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="updateConfig('2')">修改</button>
            </div>
        </div>
    </div>
</div>

<div class="modal fade" id="addModal" tabindex="-1" role="dialog"
     aria-labelledby="userInfoAddModalLabel"
     aria-hidden="true" data-backdrop='static' >
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="userInfoAddModalLabel">新增</h4>
            </div>
            <div class="modal-body">
                <form id="templateAddForm">


                    <div class="form-group form-group-30" style="display: none;">
                        <div  class="form-text-right"><span style="color: red;">*</span>选择环境</div>
                        <div class="col-sm-8">
                            <select name="envCode" class="form-control" id="addEnvCode" style="width: 100%">
                            </select>
                        </div>
                    </div>
                    <div class="form-group form-group-30" id="addAppNameDiv">
                        <div  class="form-text-right"><span style="color: red;">*</span>选择应用</div>
                        <div class="col-sm-8">
                            <select name="appName" class="form-control" id="addAppName"  style="width: 100%">

                            </select>
                        </div>
                    </div>
                    <div class="form-group form-group-30" id="addTemplateKeyDiv" >
                        <div  class="form-text-right"><span style="color: red;">*</span>选择模板</div>
                        <div class="col-sm-8">
                            <select name="templateKey" class="form-control" id="addTemplateKey"  style="width: 100%">
                            </select>
                        </div>
                    </div>

                    <div class="form-group form-group-30" >
                        <div  class="form-text-right"><span style="color: red;">*</span>优先级</div>
                        <div class="col-sm-8">
                            <input type="text" class="form-control" value="1"  name="priority" id="addPriority" placeholder="优先级"
                                   onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"
                            />
                        </div>
                    </div>
                    <div class="form-group form-group-30" >
                        <div  class="form-text-right"><span style="color: red;">*</span>启用状态</div>
                        <div class="col-sm-8">
                            <select name="status" class="form-control" id="addStatus" >
                                <option selected value="1">启用</option>
                                <option value="0">停用</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group form-group-30" style="height: 54px;" >
                        <div  class="form-text-right"><span style="color: red;">*</span>描述</div>
                        <div class="col-sm-8" style="height: 54px;">
                            <textarea type="text" class="form-control" name="description" id="addDescription" maxlength="255" placeholder="描述" ></textarea>
                        </div>
                    </div>


                    <input name="tempJson" id="addJson" type="hidden" />
                    <input type="reset" name="addReset" style="display: none;"/>
                </form>
                <fieldset style="border:1px solid black;margin-top: 5px;padding: 5px;width: 100%;">
                <legend>模板属性</legend>
                    <div id="addPropertyDiv" style="">

                    </div>
                </fieldset>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="addValue()">新建</button>
            </div>
        </div>
    </div>
</div>

<div th:replace="/common/footer :: footer"/>

<script type="text/javascript" th:src="@{/js/admin/value/value.js}"></script>
<script type="text/javascript" th:src="@{/js/admin/value/valueAndRelase.js}"></script>



</body>
</html>






